package com.viphuli.app.tool.handler;

import java.util.List;

import android.view.View;

import com.viphuli.app.tool.adapter.HolidayHomeLeaveAdapter;
import com.viphuli.app.tool.bean.page.HolidayHomePage;
import com.viphuli.app.tool.bean.part.HolidayHomeLeave;
import com.viphuli.app.tool.fragment.HolidayFragment;

public class HolidayHomeResponseHandler extends MyBaseHttpResponseHandler<HolidayFragment, HolidayHomePage> {

	@Override
	public void deal() {

		List<HolidayHomeLeave> list = page.getLeaveList();

		if (list == null || list.isEmpty()) {
			
			caller.getListview().setVisibility(View.GONE);

		} else {
			
			caller.getList().clear();
			caller.getList().addAll(list);

			HolidayHomeLeaveAdapter adapter = new HolidayHomeLeaveAdapter(caller.getList());
			caller.setAdapter(adapter);

			caller.getListview().setAdapter(adapter);
			
			caller.getListview().setVisibility(View.VISIBLE);

		}

	}

}
